@file:Suppress("unused")

package com.example.demo.model.blog

import org.springframework.beans.factory.annotation.*
import org.springframework.stereotype.*
import xyz.erupt.annotation.`fun`.*
import xyz.erupt.jpa.dao.*

@Component
class BlogTagHandler : TagsFetchHandler {

    @Autowired
    private lateinit var eruptDao: EruptDao

    override fun fetchTags(params: Array<String>): List<String> {
        val result: MutableList<String> = ArrayList()
        val map = eruptDao.queryMapList(BlogTag::class.java, null, null, "name")
        for (objectMap in map) {
            result.add(objectMap["name"].toString())
        }
        return result
    }
}